*Table A.9: Baseline measures of dietary intake (24h dietary recall)
cd ""

use "master_data_adults_child_s13456_shared.dta", clear 
drop meal_control snack_control
gen meal_control=1 if treatment==2
replace meal_control=0 if treatment==1

gen snack_control=1 if treatment==3
replace snack_control=0 if treatment==1

drop if type_id=="X" // **Dropping newborns born during the three years of study
drop if id=="3885553B" //**error in the id number and empty data
drop if id=="3885553G" //**error in the id number and empty data
replace treatment=2 if id=="38855553B" //**retrieving the correct treatment for this id
replace treatment=2 if id=="38855553G" //**retrieving the correct treatment for this id
drop if id=="101aa22c" //**this id does not exist
drop if id=="27655663" //**outlier on many measurements

***macro nutrients*****
ge food15_other_veg_new=food15_other_veg
replace food15_other_veg_new=0 if food15_other_veg==. & energykcal!=.
ge food16_fruit_new=food16_fruit
replace food16_fruit_new=0 if food16_fruit==. & energykcal!=.
su food15_other_veg 
su food16_fruit 
su food15_other_veg_new 
su food16_fruit_new
*
drop portion_veg_wisp portion_fruit_wisp
gen portion_veg_wisp=food15_other_veg/80
gen portion_fruit_wisp=food16_fruit/80
gen fuit_and_veg_g=total_veg_fruit_eatwell if session==1
replace fuit_and_veg_g=total_veg_fruit_eatwell if session==3
replace fuit_and_veg_g=food15_other_veg+food16_fruit if session==4
ge FV=food15_other_veg_new+food16_fruit_new


**Table A.9: Baseline measures of dietary intake (24h dietary recall**
***PANEL A Children 
bys treatment: su energykcal if child==1 & session==1
ranksum energykcal if child==1 & session==1, by(meal_control) 
ranksum energykcal if child==1 & session==1, by(snack_control) 
 
bys treatment: su portion_fruit_wisp if child==1 & session==1
ranksum portion_fruit_wisp if child==1 & session==1, by(meal_control) 
ranksum portion_fruit_wisp if child==1 & session==1, by(snack_control) 
 
bys treatment: su portion_veg_wisp if child==1 & session==1
ranksum portion_veg_wisp if child==1 & session==1, by(meal_control) 
ranksum portion_veg_wisp if child==1 & session==1, by(snack_control) 

bys treatment: su FV if child==1 & session==1
ranksum FV if child==1 & session==1, by(meal_control) 
ranksum FV if child==1 & session==1, by(snack_control) 

bys treatment: su totalfatg if child==1 & session==1
ranksum totalfatg if child==1 & session==1, by(meal_control) 
ranksum totalfatg if child==1 & session==1, by(snack_control) 

bys treatment: su saturatesg if child==1 & session==1
ranksum saturatesg if child==1 & session==1, by(meal_control) 
ranksum saturatesg if child==1 & session==1, by(snack_control) 

bys treatment: su sugarsg if child==1 & session==1
ranksum sugarsg if child==1 & session==1, by(meal_control) 
ranksum sugarsg if child==1 & session==1, by(snack_control) 

bys treatment: su nmesg if child==1 & session==1
ranksum nmesg if child==1 & session==1, by(meal_control) 
ranksum nmesg if child==1 & session==1, by(snack_control) 

***PANEL B Adults 
bys treatment: su energykcal if child==0 & session==1
ranksum energykcal if child==0 & session==1, by(meal_control) 
ranksum energykcal if child==0 & session==1, by(snack_control) 
 
bys treatment: su portion_fruit_wisp if child==0 & session==1
ranksum portion_fruit_wisp if child==0 & session==1, by(meal_control) 
ranksum portion_fruit_wisp if child==0 & session==1, by(snack_control) 
 
bys treatment: su portion_veg_wisp if child==0 & session==1
ranksum portion_veg_wisp if child==0 & session==1, by(meal_control) 
ranksum portion_veg_wisp if child==0 & session==1, by(snack_control) 

bys treatment: su FV if child==0 & session==1
ranksum FV if child==0 & session==1, by(meal_control) 
ranksum FV if child==0 & session==1, by(snack_control) 

bys treatment: su totalfatg if child==0 & session==1
ranksum totalfatg if child==0 & session==1, by(meal_control) 
ranksum totalfatg if child==0 & session==1, by(snack_control) 

bys treatment: su saturatesg if child==0 & session==1
ranksum saturatesg if child==0 & session==1, by(meal_control) 
ranksum saturatesg if child==0 & session==1, by(snack_control) 

bys treatment: su sugarsg if child==0 & session==1
ranksum sugarsg if child==0 & session==1, by(meal_control) 
ranksum sugarsg if child==0 & session==1, by(snack_control) 

bys treatment: su nmesg if child==0 & session==1
ranksum nmesg if child==0 & session==1, by(meal_control) 
ranksum nmesg if child==0 & session==1, by(snack_control) 

